import globals from "globals";
import pluginJs from "@eslint/js";
import pluginVue from "eslint-plugin-vue";
import vueEslintParser from 'vue-eslint-parser'; // vue文件解析器
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';


/** @type {import('eslint').Linter.Config[]} */
export default [
  {files: ["**/*.{js,mjs,cjs,vue}"]},
  {
    languageOptions: { 
      globals: {...globals.browser, ...globals.node},
      parser: vueEslintParser,
      parserOptions: {
        ecmaVersion: 'latest',
        sourceType: 'module',
      }
    }},
  pluginJs.configs.recommended,
  ...pluginVue.configs["flat/essential"],
  eslintPluginPrettierRecommended, // 放在最后面
  {
    rules: {

    },
  }
];